<!DOCTYPE html>
{extend name="../application/public/base.html" /}
{block name="head"}
	<link rel="stylesheet" href="ADMIN_CUSTOM/css/list.css">
	<link rel="stylesheet" href="ADMIN_CUSTOM/css/btn.css">
{/block}
{block name="body"}
    <body>
        <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a><cite>导航元素</cite></a>
          </span>
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right;margin-left: 10px;" onclick="location.reload()" title="刷新"><i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                    	<div class="layui-card-body">
                            <form class="layui-form layui-col-space20">
                            	<div class="layui-input-inline layui-show-xs-block">
									<label>产品分类</label>
								 	<div class="layui-input-inline">
									  	<select name="contrller" class="layui-select">
	                                        <option>全部</option>
	                                        <option>产品分类1</option>
	                                        <option>产品分类2</option>
	                                        <option>产品分类3</option>
	                                   	</select>
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
									<label>产品子分类</label>
								 	<div class="layui-input-inline">
									  	<select name="contrller" class="layui-select">
	                                        <option>全部</option>
	                                        <option>产品分类1</option>
	                                        <option>产品分类2</option>
	                                        <option>产品分类3</option>
	                                   	</select>
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
									<label>产品品牌</label>
								 	<div class="layui-input-inline">
									  	<select name="contrller" class="layui-select">
	                                        <option>全部</option>
	                                        <option>产品品牌1</option>
	                                        <option>产品品牌2</option>
	                                        <option>产品品牌3</option>
	                                   	</select>
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
									<label>产品内存</label>
								 	<div class="layui-input-inline">
									  	<select name="contrller" class="layui-select">
	                                        <option>全部</option>
	                                        <option>产品内存1</option>
	                                        <option>产品内存2</option>
	                                        <option>产品内存3</option>
	                                   	</select>
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
									<label>产品属性</label>
								 	<div class="layui-input-inline">
									  	<select name="contrller" class="layui-select">
	                                        <option>全部</option>
	                                        <option>产品属性1</option>
	                                        <option>产品属性2</option>
	                                        <option>产品属性3</option>
	                                   	</select>
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
									<label>产品颜色</label>
								 	<div class="layui-input-inline">
									  	<select name="contrller" class="layui-select">
	                                        <option>全部</option>
	                                        <option>产品颜色1</option>
	                                        <option>产品颜色2</option>
	                                        <option>产品颜色3</option>
	                                   	</select>
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
						     		<label>自定义时间</label>
								 	<div class="layui-input-inline">
									  	<input type="text" id="start" placeholder="开始日" name="start" autocomplete="off" class="layui-input">
								  	</div>
								  	<div class="layui-input-inline">
									  	<input type="text" id="end" placeholder="结束日" name="end" autocomplete="off" class="layui-input">
								  	</div>
						     	</div>
						     	<div class="layui-input-inline layui-show-xs-block">
								 	<div class="layui-input-inline keyword-search">
									  	<input type="text" id="username" placeholder="请输入关键字进行搜索" name="username" autocomplete="off" class="layui-input">
								  	</div>
						     	</div>
                                <div class="layui-input-inline layui-show-xs-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                        <i class="layui-icon">&#xe615;</i></button>
                                </div>
                            </form>
                        </div>
                        <div class="layui-card-body">
							<div class="green-border-btn">消费订单数：{$count}</div>
							<div class="green-border-btn">消费总额：{$consum}元</div>
                        </div>
                        <div class="layui-card-body">
                        	<div id="view">11111</div>
                            <div class="layui-tab layui-tab-card" id="order-list" style="margin-bottom:15px;">
							  	{volist name="list" id="v"}
							  	<ul class="order_table">
									<li>订单编号：{$v.order_sn}</li>
									<li>订单时间：{:date_time($v.addtime)}</li>
									<li>客户姓名：{$v.username}</li>
									<li>联系方式：{$v.phone}</li>
									<li>客户编号：{$v.user_sn}</li>
									<li>营业员：{$v.nkname}</li>
									<li>订单金额(元)：{$v.order_money}</li>
									<li>未付款金额(元)：{$v.stay_money}</li>
							  	</ul>
							  	<div class="layui-tab-content">
									<table class="layui-table layui-form">
									  	<thead>
											<tr>
												<th>序号</th>
												<th>产品编码</th>
												<th>产品名称</th>
												<th>IEMI</th>
												<th>S/N</th>
												<th>合同编号</th>
												<th>数量</th>
												<th>单位</th>
												<th>价格(元)</th>
												<th>状态</th>
											</tr>
									  	</thead>
									  	<tbody>
									  		{volist name="$v.goods" id="goods" key="key"}
									  		{if condition="$goods.is_show == 0"}
											<tr>
											{elseif condition="$goods.is_show == 1"/}
											<tr style="color: #A13933;">
											{else/}
											<tr style="color: #00CC00;">
											{/if}
												<td>{$key}</td>
												<td>{$goods.goods_sn}</td>
												<td>{$goods.gname}</td>
												<td>{$goods.imei}</td>
												<td>{$goods.sn}</td>
												<td>{$goods.contract_sn}</td>
												<td>{$goods.number}</td>
												<td>{$goods.unit}</td>
												{if condition="$goods.price_type == 0"}
												<td>{$goods.selling_price}</td>
												{else /}
												<td>{$goods.trade_price}</td>
												{/if}
												
												<td>{:is_show($goods.is_show)}</td>
		                                	</tr>
		                                	{/volist}
									  	</tbody>
									</table>
									<a class="layui-col-space10" href="javascript:;" onclick="xadmin.open('订单详情','order_details.html','','',true)" style="color: #009688;">
										<span>查看</span>
										<span>>></span>
									</a>
							  	</div>
							  	{/volist}
							</div>
							<!-- 分页 -->
							<div class="layui-card-body ">
	                            <div class="page">
	                            	{:$list->render()}
	                            </div>
	                        </div>
                        </div>
                    </div>
                </div>
            </div>
        </div> 
    </body>
{/block}
{block name="script"}
	<script id="demo" type="text/html">
		<!-- <%#  layui.each(d.list, function(index, item){ %>
		<%# } %>
	  	<ul class="order_table">
			<li>订单编号：{$v.order_sn}</li>
			<li>订单时间：{:date_time($v.addtime)}</li>
			<li>客户姓名：{$v.username}</li>
			<li>联系方式：{$v.phone}</li>
			<li>客户编号：{$v.user_sn}</li>
			<li>营业员：{$v.nkname}</li>
			<li>订单金额(元)：{$v.order_money}</li>
			<li>未付款金额(元)：{$v.stay_money}</li>
	  	</ul>
	  	<div class="layui-tab-content">
			<table class="layui-table layui-form">
			  	<thead>
					<tr>
						<th>序号</th>
						<th>产品编码</th>
						<th>产品名称</th>
						<th>IEMI</th>
						<th>S/N</th>
						<th>合同编号</th>
						<th>数量</th>
						<th>单位</th>
						<th>价格(元)</th>
						<th>状态</th>
					</tr>
			  	</thead>
			  	<tbody>
			  		{volist name="$v.goods" id="goods" key="key"}
			  		{if condition="$goods.is_show == 0"}
					<tr>
					{elseif condition="$goods.is_show == 1"/}
					<tr style="color: #A13933;">
					{else/}
					<tr style="color: #00CC00;">
					{/if}
						<td>{$key}</td>
						<td>{$goods.goods_sn}</td>
						<td>{$goods.gname}</td>
						<td>{$goods.imei}</td>
						<td>{$goods.sn}</td>
						<td>{$goods.contract_sn}</td>
						<td>{$goods.number}</td>
						<td>{$goods.unit}</td>
						{if condition="$goods.price_type == 0"}
						<td>{$goods.selling_price}</td>
						{else /}
						<td>{$goods.trade_price}</td>
						{/if}
						
						<td>{:is_show($goods.is_show)}</td>
                	</tr>
                	{/volist}
			  	</tbody>
			</table>
			<a class="layui-col-space10" href="javascript:;" onclick="xadmin.open('订单详情','order_details.html','','',true)" style="color: #009688;">
				<span>查看</span>
				<span>>></span>
			</a>
	  	</div> -->
	</script>
 
    <script>
    	//第三步：渲染模版
		


		layui.use(['laydate','form','laytpl'], function(){
			var laydate = layui.laydate;
			var form = layui.form;
			var laytpl = layui.laytpl;

			/*模版分隔符*/
			laytpl.config({
			  	open: '<%',
			  	close: '%>',
			});
			//执行一个laydate实例
			laydate.render({
			  	elem: '#start' //指定元素
			});

			//执行一个laydate实例
			laydate.render({
			  	elem: '#end' //指定元素
			});


			var data = { //数据
				"title":"Layui常用模块",
				"list":[{"modname":"弹层","alias":"layer","site":"layer.layui.com"},{"modname":"表单","alias":"form"}]
			}
			$.get("/user/order/index/page/1",{},function(msg){
				console.log(111)
				console.log(msg)
				// var getTpl = demo.innerHTML;
				// var view = document.getElementById('view');
				// laytpl(getTpl).render(msg, function(html){

				// 	view.innerHTML = html;
				// });
			})
			
		});
    </script>
{/block}